package com.cskaoyan.javase.network._1udp._v4;

import com.cskaoyan.javase.network.util.UDPNetworkUtils;

import java.io.IOException;
import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.util.Scanner;

/**
 *
 *
 *
 * @since 11:42
 * @author wuguidong@cskaoyan.onaliyun.com
 */
public class LongWindGoddess {
    public static void main(String[] args) throws IOException {

        // 这个socket既作为发送端,也作为接收端
        DatagramSocket socket = new DatagramSocket(6666);
        // 启动两个线程,分别执行接收消息和发送消息的任务
        new Thread(new SendMsgTask(socket, "127.0.0.1", 7777)).start();
        new Thread(new ReceiveMsgTask(socket)).start();
    }
}
